package com.jymj.entity.landmanage;

import java.math.BigDecimal;
import java.math.RoundingMode;

/**
 * Created by ${lc} on 2021/1/11.月报分数统计
 */
public class ScoreReport {
    private String zhen;
    private String code;
    private Integer cuncounts;//村数量
    private Integer bfcz;//百分村庄
    private Integer jscz;//九十分村庄
    private Integer bscz;//八十分村庄
    private Integer unqualified;//不合格村庄
    private Integer qualified;//合格分村庄
    private Integer zfs;//总分数

    private BigDecimal avgf;//平均分
    private BigDecimal qualifiedzb;//通过率
    private BigDecimal bfczzb;//百分村庄占比
    private BigDecimal jsczzb;//九十分村庄占比
    private BigDecimal bsczzb;//八十分村庄占比
    private BigDecimal unqualifiedzb;//不合格村庄占比

    public BigDecimal getAvgf() {
        return getCuncounts() == 0 ? BigDecimal.ZERO:(getZfs() == 0 ?  BigDecimal.ZERO :
        BigDecimal.valueOf(getZfs())).divide(BigDecimal.valueOf(getCuncounts()),1, RoundingMode.HALF_UP);
    }

    public BigDecimal getQualifiedzb() {
        return getCuncounts() == 0 ? BigDecimal.ZERO:(getQualified() == 0 ?  BigDecimal.ZERO :
                BigDecimal.valueOf(getQualified())).divide(BigDecimal.valueOf(getCuncounts()),4, RoundingMode.HALF_UP);
    }

    public BigDecimal getBfczzb() {
        return getCuncounts() == 0 ? BigDecimal.ZERO:(getBfcz() == 0 ?  BigDecimal.ZERO :
                BigDecimal.valueOf(getBfcz())).divide(BigDecimal.valueOf(getCuncounts()),4, RoundingMode.HALF_UP);
    }

    public BigDecimal getJsczzb() {
        return getCuncounts() == 0 ? BigDecimal.ZERO:(getJscz() == 0 ?  BigDecimal.ZERO :
                BigDecimal.valueOf(getJscz())).divide(BigDecimal.valueOf(getCuncounts()),4, RoundingMode.HALF_UP);
    }

    public BigDecimal getBsczzb() {
        return getCuncounts() == 0 ? BigDecimal.ZERO:(getBscz() == 0 ?  BigDecimal.ZERO :
                BigDecimal.valueOf(getBscz())).divide(BigDecimal.valueOf(getCuncounts()),4, RoundingMode.HALF_UP);
    }

    public BigDecimal getUnqualifiedzb() {
        return getCuncounts() == 0 ? BigDecimal.ZERO:(getUnqualified() == 0 ?  BigDecimal.ZERO :
                BigDecimal.valueOf(getUnqualified())).divide(BigDecimal.valueOf(getCuncounts()),4, RoundingMode.HALF_UP);
    }

    public String getZhen() {
        return zhen;
    }

    public void setZhen(String zhen) {
        this.zhen = zhen;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Integer getCuncounts() {
        return cuncounts == null ? 0 : cuncounts;
    }

    public void setCuncounts(Integer cuncounts) {
        this.cuncounts = cuncounts;
    }

    public Integer getBfcz() {
        return bfcz == null ? 0 : bfcz;
    }

    public void setBfcz(Integer bfcz) {
        this.bfcz = bfcz;
    }

    public Integer getJscz() {
        return jscz == null ? 0 : jscz;
    }

    public void setJscz(Integer jscz) {
        this.jscz = jscz;
    }

    public Integer getBscz() {
        return bscz  == null ? 0 : bscz;
    }

    public void setBscz(Integer bscz) {
        this.bscz = bscz;
    }

    public Integer getUnqualified() {
        return unqualified == null ? 0 : unqualified;
    }

    public void setUnqualified(Integer unqualified) {
        this.unqualified = unqualified;
    }

    public Integer getQualified() {
        return qualified == null ? 0 : qualified;
    }

    public void setQualified(Integer qualified) {
        this.qualified = qualified;
    }

    public Integer getZfs() {
        return zfs == null ? 0 : zfs;
    }

    public void setZfs(Integer zfs) {
        this.zfs = zfs;
    }
}
